<!--eslint-disable-->
<template>
    <div class="capacitance">
        <svg t="1689917809999" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
             p-id="1530" width="50" height="50">
            <path d="M486.752 52.793l21.65-12.5 181.815 314.903-21.65 12.5z" :fill="element.style.backgroundColor" p-id="1531"></path>
            <path
                d="M314.761 355.211L496.576 40.307l21.65 12.5-181.815 314.904zM55.116 812.898L236.93 497.995l21.65 12.5L76.766 825.398z"
                :fill="element.style.backgroundColor" p-id="1532"></path>
            <path d="M61.048 798.152h363.63v25H61.048zM587.598 797.918h363.629v25H587.598z" :fill="element.style.backgroundColor"
                  p-id="1533"></path>
            <path
                d="M749.578 507.962l21.65-12.5 181.815 314.904-21.65 12.5zM112.337 443.335l12.5-21.65 259.8 150-12.5 21.65zM189.341 302.337l12.5-21.65 259.8 150-12.5 21.65zM415.695 659.5h25v300h-25zM576.305 659.5h25v300h-25zM550.18 435.123l259.8-150 12.5 21.65-259.8 150z"
                :fill="element.style.backgroundColor" p-id="1534"></path>
            <path d="M630.482 574.213l259.8-150 12.5 21.65-259.8 150z" :fill="element.style.backgroundColor" p-id="1535"></path>
        </svg>
        <v-text :prop-value="element.propValue" :element="element"/>
    </div>
</template>

<script>
import request from '@/utils/request'
import OnEvent from '../../common/OnEvent'

export default {
    extends: OnEvent,
    props: {
        propValue: {
            type: String,
            required: true,
            default: '',
        },
        request: {
            type: Object,
            default: () => {
            },
        },
        element: {
            type: Object,
            default: () => {
            },
        },
    },
    data() {
        return {
            cancelRequest: null,
        }
    },
    created() {
        if (this.request) {
            this.cancelRequest = request(this.request, this.propValue, 'data')
        }
    },
    beforeDestroy() {
        this.request && this.cancelRequest()
    },
}
</script>

<style lang="scss" scoped>
.capacitance {
    display: inline-block;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    outline: 0;
    margin: 0;
    width: 100%;
    height: 100%;

    .icon {
        width: 100%;
        height: 100%;
    }

    .v-text {
        position: absolute;
        left: 50%;
        transform: translate(-50%, 0);
        width: 50%;
        height: 40%;
    }
}
</style>
